import { getTranslations, setRequestLocale } from "next-intl/server"; import { Link } from "@/i18n/navigation"; import { courses, type CourseCategory } from "@/data/courses"; import { SectionHeading } from "@/components/section-heading"; import { IconBook, IconChart, IconShield } from "@/components/icons"; import { HomeHeroCarousel } from "@/components/home-hero-carousel"; type Props = { params: Promise<{ locale: string }> }; export default async function HomePage({ params }: Props) { const { locale } = await params; setRequestLocale(locale); const t = await getTranslations("home"); const tc = await getTranslations("courses"); const featured = courses.slice(0, 5); const featuredCoverMap: Record = { trial: "/免费试听--状态--锁定、解锁.png", practical: "/系统课程--状态--锁定、解锁.png", book: "/拆书章节视频--状态--锁定、解锁.png", topic: "/专题视频-状态--锁定、解锁.png", strategy: "/策略报告--状态--锁定、解锁.png", }; const stats = [ { value: t("stat1"), label: t("stat1Label") }, { value: t("stat2"), label: t("stat2Label") }, { value: t("stat3"), label: t("stat3Label") }, { value: t("stat4"), label: t("stat4Label") }, ]; const pillars = [ { icon: IconBook, title: t("pillar1Title"), desc: t("pillar1Desc"), accent: "from-blue-500 to-indigo-600", }, { icon: IconChart, title: t("pillar2Title"), desc: t("pillar2Desc"), accent: "from-amber-500 to-orange-600", }, { icon: IconShield, title: t("pillar3Title"), desc: t("pillar3Desc"), accent: "from-emerald-500 to-teal-600", }, ]; const heroBanners = ["/banner1.png", "/banner2.png", "/banner3.png", "/banner4.png", "/banner5.png"]; return (
{/* Hero:左文案 + 右轮播 + 统一背景 */}

{t("heroEyebrow")}

{t("heroTitle")}

{t("heroSubtitle")}

{t("ctaCourses")} {t("ctaAbout")}
{/* 数据条 */}
{stats.map((s) => (

{s.value}

{s.label}

))}
{/* 三大支柱 */}
{pillars.map((p) => { const Icon = p.icon; return (

{p.title}

{p.desc}

); })}
{/* 精选课程 */}
{t("viewAll")}
{featured.map((c) => (
{/* eslint-disable-next-line @next/next/no-img-element */} {c.title} {tc("lessons", { count: c.lessonCount })}

{c.title}

{c.subtitle}

{tc("detail")}
))}
{/* CTA 带 */}

{t("ctaBandTitle")}

{t("ctaBandSubtitle")}

{t("ctaBandPrimary")} {t("ctaBandSecondary")}
); }